const initialState = {};

export const user = (state = initialState, action) => {
  // 获取登录用户信息
  if (action.type === 'user/getUserInfo') {
    return action.payload;
  }

  // 清理用户
  if (action.type === 'user/clearInfo') {
    return {};
  }

  // 初始化state
  return state;
};
